package com.example.fw;

public class ContactObject {
	public String firstname;
	public String lastname;
	public String address;
	public String home;
	public String mobile;
	public String work;
	public String email;
	public String email2;
	public String day;
	public String month;
	public String year;
	public String new_group;
	public String address2;
	public String phone2;
	public String id;
	public String title;
	
	public String getFirstname() {
		return firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public String getAddress() {
		return address;
	}

	public String getHome() {
		return home;
	}

	public String getMobile() {
		return mobile;
	}

	public String getWork() {
		return work;
	}

	public String getEmail() {
		return email;
	}

	public String getEmail2() {
		return email2;
	}

	public String getDay() {
		return day;
	}

	public String getMonth() {
		return month;
	}

	public String getYear() {
		return year;
	}

	public String getNew_group() {
		return new_group;
	}

	public String getAddress2() {
		return address2;
	}

	public String getPhone2() {
		return phone2;
	}

	public String getId() {
		return id;
	}

	public String getTitle() {
		return title;
	}

	public ContactObject setFirstname(String firstname) {
		this.firstname = firstname;
		return this;
	}

	public ContactObject setId(String id) {
		this.id = id;
		return this;
	}
	
	public ContactObject setLastname(String lastname) {
		this.lastname = lastname;
		return this;
	}
	
	public ContactObject setAddress(String address) {
		this.address = address;
		return this;}
	
	public ContactObject setHome(String home) {
		this.home = home;
		return this;
	}
	public ContactObject setMobile(String mobile) {
		this.mobile = mobile;
		return this;
	}
	
	public ContactObject setWork(String work) {
		this.work = work;
		return this;
	}
	
	public ContactObject setEmail(String email) {
		this.email = email;
		return this;
	}
	
	public ContactObject setEmail2(String email2) {
		this.email2 = email2;
		return this;
	}
	
	public ContactObject setDay(String day) {
		this.day = day;
		return this;
	}
	
	public ContactObject setMonth(String month) {
		this.month = month;
		return this;
	}
	
	public ContactObject setYear(String year) {
		this.year = year;
		return this;
	}
	
	public ContactObject setNew_group(String new_group) {
		this.new_group = new_group;
		return this;
	}
	
	public ContactObject setAddress2(String address2) {
		this.address2 = address2;
		return this;
	}
	
	public ContactObject setPhone2(String phone2) {
		this.phone2 = phone2;
		return this;}
	
	public ContactObject setTitle(String title) {
		this.title= firstname+ " " +lastname;
		return this;}
	
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((title == null) ? 0 : title.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
	
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactObject other = (ContactObject) obj;
		if (title == null) {
			if (other.title!= null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		if (id != null &&other.id != null) {
			return id.equals(other.id);
		} 
			return true;
		}
	
	@Override
	public String toString() {
		return "Contact[" + id + ":" + title + "]";
	}
}

